Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core tests: safeguard against duplicate test markers #777

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 22, 2024

Description

This commit adds a test method to both the AbstractMethodUnitTest and the AbstractTokenizerTestCase classes to automatically verify that the case file in use by a child test class only contains unique test markers.

The actual logic for the test is in a custom, static, assertion assertTestMarkersAreUnique() to allow for calling the assertion directly if an additional test case file is tokenized for the test; and to prevent duplicating the logic in both test case classes.

Includes fixing a few test markers which this new test identified as duplicates straight off.

Suggested changelog entry

Changed: the AbstractMethodUnitTest and the AbstractTokenizerTestCase will now flag duplicate test case markers in a test case file.

Related issues/external references

Fixes #773

@jrfnl jrfnl added this to the 3.11.3 milestone Dec 22, 2024
@jrfnl jrfnl force-pushed the feature/773-safeguard-against-duplicate-test-markers branch 2 times, most recently from 8169944 to 76f67ce Compare December 22, 2024 13:47
@jrfnl jrfnl modified the milestones: 3.11.3, 3.12.0 Jan 8, 2025
@jrfnl jrfnl requested a review from fredden January 23, 2025 19:20
tests/Core/AbstractMethodUnitTest.php Outdated Show resolved Hide resolved
This commit adds a new test to both the `AbstractMethodUnitTest` and the `AbstractTokenizerTestCase` classes to automatically verify that the case file in use by the child test class only contains unique test markers.

The actual logic for the test is in a custom, `static`, assertion `assertTestMarkersAreUnique()` to allow for calling the assertion directly if an additional test case file is tokenized for the test; and to prevent duplicating the logic in both test case classes.

Includes fixing a few test markers which this new test identified as duplicates straight off.

Fixes 773
@jrfnl jrfnl force-pushed the feature/773-safeguard-against-duplicate-test-markers branch from 76f67ce to 0e9c8c5 Compare January 23, 2025 22:22
@jrfnl jrfnl merged commit 154bb91 into master Jan 23, 2025
57 checks passed
@jrfnl jrfnl deleted the feature/773-safeguard-against-duplicate-test-markers branch January 23, 2025 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Core Tests: have a check for duplicate markers in inc files
2 participants